package primary;

import java.util.Arrays;
import java.util.Collections;

/**
 * 数组的拷贝
 * 1. 深拷贝 拷贝数据到新对象中
 * 2. 浅拷贝 拷贝引用地址
 */
public class L_ArrayCopy {
    public static void main(String[] args) {
        String[] s1 = {"aa", "bb", "cc", "dd", "ee"};
        String[] s2 = new String[10];

        System.arraycopy(s1, 2, s2, 6, 3);
        System.out.println(Arrays.toString(s1));
        String[] s3 = s1.clone();
        String[] s4 = s1;
        System.out.println("s1=" + s1);
        System.out.println("s2=" + s2);
        System.out.println("s3=" + s3);
        System.out.println("s4=" + s4);
    }

}
